package com.zzyl.service.impl;

import com.zzyl.dto.LoginDto;
import com.zzyl.mapper.UserMapper;
import com.zzyl.service.UserService;
import com.zzyl.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description UserServiceImpl
 * @Author liruzhuang
 * @Date 2024-10-17
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    /**
     * 查询用户信息
     * @param loginDto
     * @return
     */
    @Override
    public UserVo getUser(LoginDto loginDto) {
        UserVo userVo=userMapper.getUser(loginDto);
        //根据用户名查询出用户信息  对密码进行加密密然后对比
//        String password = encryptPassword(loginDto.getPassword());
//        boolean a = userVo.getPassword().equals(password);
//        if (userVo==null || a==false){
//            throw new BaseException(BasicEnum.LOGIN_FAIL);
//        }
        return userVo;
    }
}
